import { HintBtnView } from "../../mapUI/HintBtnView";
import { ObjCreate } from "../../common/ObjCreate";
import { ResFileConst } from "../../../resource/ResFileConst";
import { LayerManager } from "../../../manager/LayerManager";
import { RightTopLayerLine } from "../../../manager/RightTopLayerLine";
import { RightTopLayerIndex } from "../../../manager/RightTopLayerIndex";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
//class RechargeActiveBtnIcon
    
    export  class RechargeActiveBtnIcon extends HintBtnView
    {
        constructor()
        {
            super();
            if (RechargeActiveBtnIcon._instance != null) 
            {
                throw new Error("RechargeActiveBtnIcon单例");
            }
            this.showRechargeActiveBtn();
            return;
        }

        /* internal  */showRechargeActiveBtn(): void
        {
            buttonMode = true;
            this._rechargeActiveBtn = ObjCreate.createGLoadedButton(ResFileConst.LimitTimeBtn, 0, 0, 60, 50, this);
            this._rechargeActiveBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onInterFlowerClickHandler);
            layer = LayerManager.rightTopUILayer;
            this.line = RightTopLayerLine.lineOne;
            this.index = RightTopLayerIndex.RechargeActiveBtn;
            return;
        }

        /* internal  */onInterFlowerClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.RechargeActiveWindowOpen));
            return;
        }

        public static get instance(): RechargeActiveBtnIcon
        {
            if (RechargeActiveBtnIcon._instance == null) 
            {
                RechargeActiveBtnIcon._instance = new RechargeActiveBtnIcon();
            }
            return RechargeActiveBtnIcon._instance;
        }

        /* internal */ /* var */_rechargeActiveBtn: GLoadedButton;

        /* internal */ static /* var */_instance: RechargeActiveBtnIcon;
    }
